package com.hello.controller;

import com.hello.model.Product;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.Arrays;
import java.util.List;

/**
 * @author chengfan
 * @create 2017-05-08 下午7:57
 */
@RestController
public class DataController {

    @RequestMapping("/product")
    public Product product(){
        return new Product("Apple", 10.00);
    }

    @RequestMapping("products")
    public List<Product> Products(){
        return Arrays.asList(new Product("Apple", 11.00), new Product("Orange", 12.00));
    }
}
